public class User {
    private String account;
    private String password;
    private String email; // optional field

    // Constructor with email parameter
    public User(String account, String password, String email) {
        this.account = account;
        this.password = password;
        this.email = email;
    }

    // Overloaded constructor without email parameter
    public User(String account, String password) {
        this(account, password, null); // Call the main constructor with email as null
    }

    public void displayInfo() {
        System.out.println("账号: " + account + ", 密码: " + password + (email == null ? "" : (", 邮箱: " + email)));
    }

    public static void main(String[] args) {
        User user1 = new User("114514", "1919810");
        User user2 = new User("ciallo", "0721", "gouxiujin.com");
        user1.displayInfo();
        user2.displayInfo();
    }
}

